macromedia Your Account International Help
Products Support & Training DevNet Solutions Partners Downloads Store
Products Support & Training DevNet Solutions Partners Downloads Store
Home > Products > Flash > Support > TechNote Index
Macromedia Flash Support Center - TechNote

Tips for viewing XML generated in a trace output window or a visual property editor

XML generated in output window or visual property editor
At times developers may want to see Firefly-generated XML in a more convenient format than Firefly offers. Features such as color coding of XML code, line breaks, and indentation may be needed in these instances.

Two instances in which Firefly generates XML inside of Flash are when creating a map file in the FxDataSet visual property editor and viewing the trace output for a DeltaPacket in the TimeTrax tutorial. This XML is usually in the format of one long string, and in the visual property editor it's displayed in a small text box that hides most of the text from view.

What is a Firefly map file?
When working with XML data in Firefly, the data must be mapped into an FxDataSet. The mapping information is stored as XML and referred to as a Firefly map file. There are several ways to create and use a map file:
1 Use the FxDataSet component visual property editor to create the FxDataSet fields, set default properties, and map them to a node in an XML file.
2 Manually create an XML mapping file using your favorite XML or text editor.
3 Point to an existing Firefly map file on a server or hard disk using the Map Source property of the FxDataSet component.

For more information about creating map files, see the Firefly documentation:
Firefly Components Help > Tutorials > Advanced Topics > Map XML using the FxDataSet
.

If using option 1 to create the map file, Firefly will generate the Map Source XML for you, however, it's displayed in a small text field in the Properties tab of the FxDataSet's visual property editor, as shown below:
map source visual property editor

 

XML in the trace output window
Developers frequently create functions to display XML generated in Flash, using this for informational or debugging purposes. This allows developers to see the XML that Flash sends to other applications.

For example, in the TimeTrax tutorial that ships with the Firefly Components there is a button named Show DeltaPacket. When you run the application in Test Movie, make changes to the grid, and then click the Show DeltaPacket, a trace output window appears showing the XML generated for the DeltaPacket. However, the XML file is displayed as one long string, making it difficult to visualize the XML structure.
trace output window

How can I view the Map Source XML and trace output XML in an easier to read format?
To view the Map Source XML or trace output XML code for troubleshooting or learning purposes follow this mini-tutorial.
1 Download TextPad for free from textpad.com or download.com, and install it on your local machine. Any preferred text editor can also be used.
2 Download Internet Explorer 6 from the Microsoft website. This browser is useful since it parses the XML and displays it on the screen in an easy to read tree format. If using another browser, you may have to view the page as source code to see the XML format.
3 Launch TextPad or another text editor.
4 Launch Flash and open the visual property editor for the FxDataSet component, as shown in the image of the Component Parameters dialog box above.
5 Highlight all text inside the Map Source field or trace output window. In the visual property editor, you can alternatively right-click and choose Select All.
6 Once the XML code is highlighted, right-click and choose Copy. In the trace output dialog box, you can alternatively click the Options drop-down menu and choose Copy.
7 Switch to TextPad, open a new file and paste the XML code.
  TextPad screenshot
8 Save the XML file giving it a .xml extension (e.g. myFile.xml).
9 Right-click anywhere in the body of the XML file and choose Properties.
10 In the Properties dialog box select the Preferences tab and check the checkbox labeled View in Web Browser. Click OK.
  TextPad preferences dialog box
11 You should now be able to right-click again anywhere in the body of the XML file, choose Properties and then choose View in Web Browser.
12 Internet Explorer 6 should launch displaying the XML file generated by Firefly. Internet Explorer color codes the XML and allows you to expand and collapse the XML nodes for easier viewing.
  XML file in Internet Explorer 6

Note: Macromedia does not provide technical support for third-party products, such as TextPad. If you have TextPad configuration questions, please consult the TextPad documentation or contact TextPad technical support.

ID: 18635
Product: Flash
Versions: MX
OS: Windows-All
Browser: All
Server: None
Database: All
Former ID:  
How useful was this document?
less more

1

2

3

4

5

How can the document be improved? (300 characters or less - you will not receive a reply.)

Last updated: April 21, 2003
Created: April 29, 2003